package com.test.demo1.service.impl;

import com.github.pagehelper.PageHelper;
import com.test.demo1.bean.Items;
import com.test.demo1.common.BaseServiceImpl;
import com.test.demo1.common.PageRequest;
import com.test.demo1.mapper.ItemsMapper;
import com.test.demo1.service.ItemsService;
import org.springframework.stereotype.Service;

import java.math.BigInteger;
import java.util.List;
import com.github.pagehelper.PageInfo;
/**
 * (Items)表服务实现类
 *
 * @author makejava
 * @since 2025-08-31 08:11:38
 */
@Service
public class ItemsServiceImpl extends BaseServiceImpl<Items, BigInteger> implements ItemsService {
    
    private ItemsMapper itemsMapper;
    public ItemsServiceImpl(ItemsMapper itemsMapper){
    this.itemsMapper=itemsMapper;
    }
    /**
     * 分页查询
     *
     * @param items 筛选条件
     * @return 查询结果
     */
    @Override
    public PageInfo<Items> queryByPage(PageRequest<Items> request) {
    Items requestParam = request.getParam();
        if (requestParam==null){
            requestParam=new Items();
        }
        PageHelper.startPage(request.getPageIndex(),request.getPageSize());
        List<Items> list =itemsMapper.queryAll(requestParam);
        return new PageInfo<>(list);
    }
}
